

*********Replication code for "Do Citizens Link Attitudes with Preferences? Economic Inequality and Government Spending in the �New Gilded Age� Thomas J. Hayes
********SSQ 2014*************

*****Use this code with survey data from the 1996 Gneral Social Survey (GSS) 

gen educspend=.
replace educspend=0 if spschool==5 
replace educspend=1 if spschool==4 
replace educspend=2 if spschool==3 
replace educspend=3 if spschool==2
replace educspend=4 if spschool==1
label var educspend "educspend"
label define educspend 0 "much less" 4 "spend much more" 
label value educspend educspend
tab educspend

gen healthspend=.
replace healthspend=0 if sphlth==5 
replace healthspend=1 if sphlth==4 
replace healthspend=2 if sphlth==3 
replace healthspend=3 if sphlth==2
replace healthspend=4 if sphlth==1
label var healthspend "healthspend"
label define healthspend 0 "much less" 4 "spend much more" 
label value healthspend healthspend
tab healthspend

gen retirespend=.
replace retirespend=0 if spretire==5 
replace retirespend=1 if spretire==4 
replace retirespend=2 if spretire==3 
replace retirespend=3 if spretire==2
replace retirespend=4 if spretire==1
label var retirespend "retirespend"
label define retirespend 0 "much less" 4 "spend much more" 
label value retirespend retirespend
tab retirespend

gen unempspend=.
replace unempspend=0 if spunemp==5 
replace unempspend=1 if spunemp==4 
replace unempspend=2 if spunemp==3 
replace unempspend=3 if spunemp==2
replace unempspend=4 if spunemp==1
label var unempspend "unempspend"
label define unempspend 0 "much less" 4 "spend much more" 
label value unempspend unempspend
tab unempspend

******************************
********policy mood variable**
******************************
gen spendmood2=(unempspend+healthspend+educspend+retirespend)/4


****************************
****inequality measures*****
****************************

***************incgap recode full**********
gen gap2=.
replace gap2=0 if incgap==5    
replace gap2=1 if incgap==4 
replace gap2=2 if incgap==3 
replace gap2=3 if incgap==2
replace gap2=4 if incgap==1
label var gap2 "gap2"
label define gap2 0 "Strongly Disagree" 4 "Strongly Agree" 
label value gap2 gap2
tab gap2


***************inequal3 recode full**********
gen in31=.
replace in31=0 if inequal3==5    
replace in31=1 if inequal3==4 
replace in31=2 if inequal3==3 
replace in31=3 if inequal3==2
replace in31=4 if inequal3==1
label var in31 "in31"
label define in31 0 "Strongly Disagree" 4 "Strongly Agree" 
label value in31 in31
tab in31

********************should govt reduce income differences?********
generate redineq=.
replace redineq=0 if eqwlth==7
replace redineq=1 if eqwlth==6
replace redineq=2 if eqwlth==5
replace redineq=3 if eqwlth==4
replace redineq=4 if eqwlth==3
replace redineq=5 if eqwlth==2
replace redineq=6 if eqwlth==1
label var redineq "redineq"
label define redineq 0 "Oppose" 6 "Favor" 
label value redineq redineq
tab redineq


***Controls***

****black****
gen black=.
replace black=1 if race==2
replace black=0 if race==3 | race==1

*********female********
gen female=.
replace female=1 if sex==2
replace female=0 if sex==1

************partyid***************
generate party=.
replace party=0 if partyid==0 | partyid==1 | partyid==2
replace party=1 if partyid==3 | partyid==7
replace party=2 if partyid==4 | partyid==5 | partyid==6
label var party "party"
label define party 0 "dem" 1 "ind" 2 "gop" 
label value party party
tab party

********************coninc******combined income***
gen class1=.
replace class1=0 if coninc<=22000
replace class1=1 if coninc>=22000 & coninc<=75000
replace class1=2 if coninc>=75000

****satisfaction with financial situation****
generate personalecon=.
replace personalecon=0 if satfin==3
replace personalecon=1 if satfin==2
replace personalecon=2 if satfin==1 
label var personalecon "personalecon"
label define personalecon 0 "not at all" 1 "more or less" 2 "satisfied" 
label value personalecon personalecon
tab personalecon

***************
generate polint1=.
replace polint1=0 if polint==5
replace polint1=1 if polint==4
replace polint1=2 if polint==3 
replace polint1=3 if polint==2
replace polint1=4 if polint==1
label var polint1 "polint1"
label define polint1 0 "not at all" 4 "very interested" 
label value polint1 polint1
tab polint1

***************ideology
generate polviews1=.
replace polviews1=0 if polviews==1
replace polviews1=1 if polviews==2
replace polviews1=2 if polviews==3 
replace polviews1=3 if polviews==4
replace polviews1=4 if polviews==5
replace polviews1=5 if polviews==6
replace polviews1=6 if polviews==7
label var polviews1 "polviews1"
label define polviews1 0 "extremely liberal" 7 "extremely conservative" 
label value polviews1 polviews1
tab polviews1

*******************party id
generate partyid1=.
replace partyid1=-1 if partyid==0 | partyid==1 | partyid==2 
replace partyid1=0 if partyid==3
replace partyid1=1 if partyid==4 | partyid==5 | partyid==6  
label var partyid1 "partyid1"
label define partyid1 -1 "democrat" 0 "independent" 1 "republican" 
label value partyid1 partyid1
tab partyid1


***educ***
gen education=educ
replace education=0 if educ<=11
replace education=1 if educ==12
replace education=2 if educ>=13 & educ<=15 
replace education=3 if educ>=16 
replace education=4 if educ>=17
label var education "education"
label define education 0 "less than high school" 1 "high school" 2 "some college" 3 "college degree" 4 "graduate/professional"
label value education
tab education

**************************
gen religion=.
replace religion=1 if relig==1
replace religion=2 if relig==2
replace religion=3 if relig==3
replace religion=4 if relig==4
replace religion=5 if relig==5 | relig==6 | relig==7 | relig==8 | relig==9 | relig==10
label var religion "religion"
label define religion 1 "protestant" 2 "catholic" 3 "jewish" 4 "none" 5 "other"
label value religion religion
tab religion

*******************************
*****gen interactions for class
*******************************
gen classgap=class1*gap2

gen classin31=class1*in31

gen classredineq=class1*redineq

**********************************************
*************Table 1**************************
**********************************************
eststo clear
reg spendmood2 redineq degree age female black class1 polviews1 partyid1 personalecon polint1 attend
eststo
reg spendmood2 gap2 degree age female black class1 polviews1 partyid1 personalecon polint1 attend
eststo
reg spendmood2 in31 degree age female black class1 polviews1 partyid1 personalecon polint1 attend
eststo
reg spendmood2 redineq degree age female black class1 polviews1 partyid1 personalecon polint1 attend classredineq
eststo
reg spendmood2 gap2 degree age female black class1 polviews1 partyid1 personalecon polint1 attend classgap
eststo
reg spendmood2 in31 degree age female black class1 polviews1 partyid1 personalecon polint1 attend classin31
eststo
esttab using  "C:\Users\Tom\Desktop\Research Projects\Public Mood\mood1.rtf", replace label se r2 starlevels(* .10 ** .05 *** .01)

**********************************************
*************Figure 1*************************
**********************************************
reg spendmood2 redineq degree age female black class1 polviews1 partyid1 personalecon polint1 attend
margins, at(redineq=(0(1)6)) atmeans vsquish post
marginsplot, recast(line) recastci(rarea) yscale(range(0 4)) ylabel(0(1)4) title(Predicted Probability of Favorability toward Government Spending) name(a)

reg spendmood2 gap2 degree age female black class1 polviews1 partyid1 personalecon polint1 attend
margins, at(gap2=(0(.2)1)) atmeans vsquish post
marginsplot, recast(line) recastci(rarea) yscale(range(0 4)) ylabel(0(1)4) name(b)

reg spendmood2 in31 degree age female black class1 polviews1 partyid1 personalecon polint1 attend
margins, at(in31=(0(.2)1)) atmeans vsquish post
marginsplot, recast(line) recastci(rarea) yscale(range(0 4)) ylabel(0(1)4) name(c)

graph combine a b c, r(2) graphregion(color(white)) scheme(s1mono) altshrink 

**********************************************
*************Figure 2*************************
**********************************************

***republicans****
reg spendmood2 redineq degree age female black class1 polviews1 personalecon polint1 attend if partyid1==1
margins, at(redineq=(0(1)6)) atmeans vsquish post
marginsplot, recast(line) recastci(rarea) title(Republicans) yscale(range(0 4)) ytitle("Policy Mood") xtitle("Government Should Reduce Income Differences") xlabel(0(1)6) name(repspendmood)

**************Dems***********
reg spendmood2 redineq degree age female black class1 polviews1 personalecon polint1 attend if partyid1==-1
margins, at(redineq=(0(1)6)) atmeans vsquish post
marginsplot, recast(line) recastci(rarea) title(Democrats) yscale(range(0 4)) ytitle("Policy Mood") xtitle("Government Should Reduce Income Differences") xlabel(0(1)6) name(demspendmood)

*****************conservatives************** 
reg spendmood2 redineq degree age female black class1 polviews1 personalecon polint1 attend if polviews2==2
margins, at(redineq=(0(1)6)) atmeans vsquish post
marginsplot, recast(line) recastci(rarea) title(Conservatives) yscale(range(0 4)) ytitle("Policy Mood") xtitle("Government Should Reduce Income Differences") xlabel(0(1)6) name(conspendmood)

**************liberals***********
reg spendmood2 redineq degree age female black class1 polviews1 personalecon polint1 attend if polviews2==0
margins, at(redineq=(0(1)6)) atmeans vsquish post
marginsplot, recast(line) recastci(rarea) title(Liberals) yscale(range(0 4)) ytitle("Policy Mood") xtitle("Government Should Reduce Income Differences") xlabel(0(1)6) name(libspendmood)

graph combine repspendmood demspendmood conspendmood libspendmood







*****************Alternative Measures (appendix), Disaggragated Spending Measures***********

***********************************************************
************************by each spending measure*********
***education spending
ologit  educspend redineq degree age female class1 poordum polviews1 partyid1 personalecon polint1 attend

ologit  educspend gap2 degree age female black class1 polviews1 partyid1 personalecon polint1 attend

ologit  educspend in31 degree age female black class1 polviews1 partyid1 personalecon polint1 attend

****unemployment spending
ologit  unempspend redineq degree age female black class1 polviews1 partyid1 personalecon polint1 attend

ologit  unempspend gap2 degree age female black class1 polviews1 partyid1 personalecon polint1 attend

ologit  unempspend in31 degree age female black class1 polviews1 partyid1 personalecon polint1 attend

***health care spending
ologit  healthspend redineq degree age female black class1 polviews1 partyid1 personalecon polint1 attend

ologit  healthspend gap2 degree age female black class1 polviews1 partyid1 personalecon polint1 attend

ologit  healthspend in31 degree age female black class1 polviews1 partyid1 personalecon polint1 attend

*****retirement spending
ologit  retirespend redineq degree age female black class1 polviews1 partyid1 personalecon polint1 attend

ologit  retirespend gap2 degree age female black class1 polviews1 partyid1 personalecon polint1 attend

ologit  retirespend in31 degree age female black class1 polviews1 partyid1 personalecon polint1 attend
